check.BaseDataQualityQuery = Ext.extend(Ext.Panel, {
		    width: '100%',
		    height: '100%',
		    renderTo:null,
			win:null,
		    
		    //表单元素
		    row1: {
				layout:'column',
				bodyStyle:'border-width:0;',
				items:[{
					columnWidth:.5,
		            layout:'form',
		            bodyStyle:'border-width:0;',
		            //baseCls:'x-plain',
		            items:[{
		            	id:'checkDate',
		            	xtype:'combo',
		            	labelStyle:'text-align:right;',
		            	editable:false,
		                fieldLabel:'起止日期',
		                forceSelection:true,
    					allowBlank: false,
    					width:320,
		                mode:'local',
		                triggerAction:'all',
					    store: new Ext.data.Store({
					    	autoLoad:true,
	                        url: AJAX_ROOT_URL+'/dataquality/queryDateRecord',
				            reader: new Ext.data.JsonReader({}, ['value', 'text']),
				            listeners:{
					    		'load':function(store,record,opts) {
					    			Ext.getCmp("checkDate").setValue(store.data.items[0].data.value);
				    			}
					    	}
				        }),
					    valueField: 'value',
					    displayField: 'text'
		            }]
				},{
					columnWidth:.5,
		            layout:'form',
		            bodyStyle:'border-width:0;',
		            //baseCls:'x-plain',
		            items:[{
		            	id:'product',
		            	xtype:'combo',
		            	labelStyle:'text-align:right;',
		            	editable:false,
		                fieldLabel:'产品线',
		                mode:'local',
		                triggerAction:'all',
    					//lazyRender:true,
					    store: new Ext.data.Store({
					    	autoLoad:true,
	                        url: AJAX_ROOT_URL+'/dataquality/queryProduct',
				            reader: new Ext.data.JsonReader({}, ['departcode', 'departname']),
				            listeners:{
					    		'load':function(store,record,opts) {
					    			Ext.getCmp("product").setValue(store.data.items[0].data.departcode);
				    			}
					    	}
				        }),
					    valueField: 'departcode',
					    displayField: 'departname',
					    listeners:{
		            		'select':function(cmp,record,index) {
		            			if (Ext.getCmp('checkPoint')) {
			            			Ext.getCmp('checkPoint').store.removeAll();
			            			Ext.getCmp('checkPoint').store.load({
			            				params: {
											'checkDate': Ext.getCmp('checkDate').getValue(),
							                'product': cmp.getValue(),
							                'comcode': Ext.getCmp("comcode").data.comcode
							            }
			            			});
		            			}
		            		}
					    }
		            }]
				}]
		    },
		    row2:{
		    	layout:'column',
				bodyStyle:'border-width:0;',
				items:[{
					columnWidth:.5,
		            layout:'form',
		            bodyStyle:'border-width:0;',
		            //baseCls:'x-plain',
		            items:[{
		            	id:'comcode',
		            	xtype:'textfield',
		            	labelStyle:'text-align:right;',
		            	width:320,
		            	readOnly:true,
		                fieldLabel:'组织机构',
		                listeners:{
		            		'render':function(thisCmp) {
		            			Ext.Ajax.request({
									url: AJAX_ROOT_URL+'/dataquality/queryProvince',
								   	success: function(response, opts) {
										var companyJsonArray = Ext.decode(response.responseText);
										thisCmp.data = companyJsonArray[0];
										thisCmp.setValue('['+Ext.util.Format.trim(companyJsonArray[0].comcode)+']'+Ext.util.Format.trim(companyJsonArray[0].comcname));
								   	}
								});
		            		},
		            		'focus':function(field){
		            			if (!Ext.getCmp('comWin')) {
			            			window.win = new Ext.Window({
			            				id:'comWin',
			            				title:'选择组织机构(双击)',
			            				renderTo:Ext.getBody(),
			            				width:450,
			            				height:400,
			            				y:80,
			            				modal:true,
			            				autoScroll:true,
			            				items:[{
			            					xtype:'treepanel',
											animate:true,
										    header:false,
										    border:false,
										    collapsible:true,
										    rootVisible:false,
										    autoScroll:true,
										    autoHeight:true,
										    //containerScroll: true,
										    split: true,
										    padding:'5 0 0 0',
										    //useArrows:true,
										    width:'100%',
										    expanded:true,
										    loader: new Ext.tree.TreeLoader({  
											    dataUrl:AJAX_ROOT_URL+'/dataquality/companyTree',
										        preloadChildren: true,//若为true，则loader在节点第一次访问时加载"children"的属性  
										        clearOnLoad: false,
										        listeners:{
										    		'beforeload':function(loader,node) {
										         		loader.baseParams['comcode'] = node.attributes.comcode;
										         		loader.baseParams['uppcomcode'] = node.attributes.uppcomcode;
										         		loader.baseParams['gradelevel'] = node.attributes.gradelevel;
											        }
										        }
										    }),  
										    root:{
								  				id:'0',
								  				comcode:'00000000',
												text:'组织机构',
										        nodeType: 'async',
										        expanded:true
										    },
											listeners:{
												'close':function(p){
			            							window.win = null;
												},
												'dblclick':function(node,e) {
													Ext.getCmp('comcode').setValue('['+node.attributes.comcode+']'+node.attributes.comcname);
													Ext.getCmp('comcode').data = node.attributes;
													
													Ext.getCmp('checkPoint').store.load({
							            				params: {
															'checkDate': Ext.getCmp('checkDate').getValue(),
											                'product': Ext.getCmp('product').getValue(),
											                'comcode': node.attributes.comcode
											            }
							            			});
													e.stopEvent();
													window.win.hide();
												}
											}
			            				}]
			            			});
			            			}
		            			window.win.show();
		            		}
		                }
	                }]
                }, {
                	columnWidth:.5,
		            layout:'form',
		            bodyStyle:'border-width:0;',
		            //baseCls:'x-plain',
		            items:[{
		            	id:'checkPoint',
		            	xtype:'combo',
		            	labelStyle:'text-align:right;',
		            	editable:false,
		                fieldLabel:'检查点',
		                width:400,
		                mode:'local',
		                triggerAction:'all',
    					//lazyRender:true,
    					//blankText: '----',
    					//emptyText: '----',
					    store: new Ext.data.Store({
					    	autoLoad:true,
	                        url: AJAX_ROOT_URL+'/dataquality/queryCheckPoint',
				            reader: new Ext.data.JsonReader({}, ['checkpoint', 'checkpointname']),
				            listeners:{
					    		'load':function(store,record,opts) {
					    			if (Ext.getCmp('checkPoint')) {
					    				Ext.getCmp("checkPoint").setValue(store.data.items[0].data.checkpoint);
					    			}
				    			}
					    	}
				        }),
					    valueField: 'checkpoint',
					    displayField: 'checkpointname'
		            }]
                }]
		    },
		    
		    createFormElement: function(config){
		    	var elementArray = [];
		    	//表单元素
			    var row1 = {
					layout:'column',
					bodyStyle:'border-width:0;',
					items:[{
						columnWidth:.5,
			            layout:'form',
			            bodyStyle:'border-width:0;',
			            //baseCls:'x-plain',
			            items:[{
			            	id:'checkDate',
			            	xtype:'combo',
			            	labelStyle:'text-align:right;',
			            	editable:false,
			                fieldLabel:'起止日期',
			                forceSelection:true,
	    					allowBlank: false,
	    					anchor:'100%',
			                mode:'local',
			                triggerAction:'all',
						    store: new Ext.data.Store({
						    	autoLoad:true,
		                        url: AJAX_ROOT_URL+'/dataquality/queryDateRecord',
					            reader: new Ext.data.JsonReader({}, ['value', 'text']),
					            listeners:{
						    		'load':function(store,record,opts) {
						    			Ext.getCmp("checkDate").setValue(store.data.items[0].data.value);
					    			}
						    	}
					        }),
						    valueField: 'value',
						    displayField: 'text'
			            }]
					},{
						columnWidth:.5,
			            layout:'form',
			            bodyStyle:'border-width:0;',
			            //baseCls:'x-plain',
			            items:[{
			            	id:'product',
			            	xtype:'combo',
			            	labelStyle:'text-align:right;',
			            	editable:false,
			                fieldLabel:'产品线',
			                anchor:'100%',
			                mode:'local',
			                triggerAction:'all',
	    					//lazyRender:true,
						    store: new Ext.data.Store({
						    	autoLoad:true,
		                        url: AJAX_ROOT_URL+'/dataquality/queryProduct',
					            reader: new Ext.data.JsonReader({}, ['departcode', 'departname']),
					            listeners:{
						    		'load':function(store,record,opts) {
						    			Ext.getCmp("product").setValue(store.data.items[0].data.departcode);
					    			}
						    	}
					        }),
						    valueField: 'departcode',
						    displayField: 'departname',
						    listeners:{
			            		'select':function(cmp,record,index) {
			            			if (Ext.getCmp('checkPoint')) {
				            			Ext.getCmp('checkPoint').store.removeAll();
				            			Ext.getCmp('checkPoint').store.load({
				            				params: {
												'checkDate': Ext.getCmp('checkDate').getValue(),
								                'product': cmp.getValue(),
								                'comcode': Ext.getCmp("comcode").data.comcode
								            }
				            			});
				            		}
			            		}
						    }
			            }]
					}]
			    };
			    var row2;
			    if (config.needCheckPoint) {
			    	row2 = {
				    	layout:'column',
						bodyStyle:'border-width:0;',
						items:[{
							columnWidth:.5,
				            layout:'form',
				            bodyStyle:'border-width:0;',
				            //baseCls:'x-plain',
				            items:[{
				            	id:'comcode',
				            	xtype:'textfield',
				            	labelStyle:'text-align:right;',
				            	readOnly:true,
				                fieldLabel:'组织机构',
				                anchor:'100%',
				                data: config.userCompany,
				                value: config.userCompany.text,
				                listeners:{
				            		'render':function(thisCmp) {
				            			//console.info(config.userCompany);
				            			//Ext.Ajax.request({
										//	url: AJAX_ROOT_URL+'/dataquality/queryProvince',
										//   	success: function(response, opts) {
										//		var companyJsonArray = Ext.decode(response.responseText);
										//		thisCmp.data = companyJsonArray[0];
										//		thisCmp.setValue('['+Ext.util.Format.trim(companyJsonArray[0].comcode)+']'+Ext.util.Format.trim(companyJsonArray[0].comcname));
										//   	}
										//});
				            		},
				            		'focus':function(field){
				            			if (!Ext.getCmp('comWin')) {
					            			window.win = new Ext.Window({
					            				id:'comWin',
					            				title:'选择组织机构(双击)',
					            				renderTo:Ext.getBody(),
					            				width:450,
					            				height:400,
					            				y:80,
					            				modal:true,
					            				autoScroll:true,
					            				items:[{
					            					xtype:'treepanel',
													animate:true,
												    header:false,
												    border:false,
												    collapsible:true,
												    rootVisible:true,
												    autoScroll:true,
												    autoHeight:true,
												    //containerScroll: true,
												    split: true,
												    padding:'5 0 0 0',
												    //useArrows:true,
												    width:'100%',
												    expanded:true,
												    loader: new Ext.tree.TreeLoader({  
													    dataUrl:AJAX_ROOT_URL+'/dataquality/companyTree',
												        preloadChildren: true,//若为true，则loader在节点第一次访问时加载"children"的属性  
												        clearOnLoad: false,
												        listeners:{
												    		'beforeload':function(loader,node) {
												         		loader.baseParams['comcode'] = node.attributes.comcode;
												         		loader.baseParams['uppcomcode'] = node.attributes.uppcomcode;
												         		loader.baseParams['gradelevel'] = node.attributes.gradelevel;
													        }
												        }
												    }),  
												    root:{
										  				id:'0',
										  				comcode:config.userCompany.comcode,
										  				uppcomcode: config.userCompany.uppcomcode,
										  				gradelevel: config.userCompany.gradelevel,
														text: config.userCompany.text,
												        leaf:config.userCompany.leaf,
												        comcname:config.userCompany.comcname,
												        nodeType: 'async'
												    },
													listeners:{
														'close':function(p){
					            							window.win = null;
														},
														'dblclick':function(node,e) {
															Ext.getCmp('comcode').setValue('['+node.attributes.comcode+']'+node.attributes.comcname);
															Ext.getCmp('comcode').data = node.attributes;
															
															Ext.getCmp('checkPoint').store.load({
									            				params: {
																	'checkDate': Ext.getCmp('checkDate').getValue(),
													                'product': Ext.getCmp('product').getValue(),
													                'comcode': node.attributes.comcode
													            }
									            			});
															e.stopEvent();
															window.win.hide();
														}
													}
					            				}]
					            			});
					            			}
				            			window.win.show();
				            		}
				                }
			                }]
		                }, {
		                	columnWidth:.5,
				            layout:'form',
				            bodyStyle:'border-width:0;',
				            //baseCls:'x-plain',
				            items:[{
				            	id:'checkPoint',
				            	xtype:'combo',
				            	labelStyle:'text-align:right;',
				            	editable:false,
				                fieldLabel:'检查点',
				                triggerAction:'all',
				                mode:'local',
				                anchor:'100%',
		    					//lazyRender:true,
		    					//blankText: '----',
		    					//emptyText: '----',
							    store: new Ext.data.Store({
							    	autoLoad:true,
			                        url: AJAX_ROOT_URL+'/dataquality/queryCheckPoint?isConsistency='+config.isConsistency,
						            reader: new Ext.data.JsonReader({}, ['checkpoint', 'checkpointname']),
						            listeners:{
							    		'load':function(store,record,opts) {
							    			Ext.getCmp("checkPoint").setValue(store.data.items[0].data.checkpoint);
						    			}
							    	}
						        }),
							    valueField: 'checkpoint',
							    displayField: 'checkpointname'
				            }]
		                }]
				    };
			    } else {
			    	row2 = {
				    	layout:'column',
						bodyStyle:'border-width:0;',
						items:[{
							columnWidth:.5,
				            layout:'form',
				            bodyStyle:'border-width:0;',
				            //baseCls:'x-plain',
				            items:[{
				            	id:'comcode',
				            	xtype:'textfield',
				            	labelStyle:'text-align:right;',
				            	readOnly:true,
				                fieldLabel:'组织机构',
				                anchor:'100%',
				                data: config.userCompany,
				                value: config.userCompany.text,
				                listeners:{
				            		'render':function(thisCmp) {
				            			//console.info(config.userCompany);
				            			//Ext.Ajax.request({
										//	url: AJAX_ROOT_URL+'/dataquality/queryProvince',
										//   	success: function(response, opts) {
										//		var companyJsonArray = Ext.decode(response.responseText);
										//		thisCmp.data = companyJsonArray[0];
										//		thisCmp.setValue('['+Ext.util.Format.trim(companyJsonArray[0].comcode)+']'+Ext.util.Format.trim(companyJsonArray[0].comcname));
										//   	}
										//});
				            		},
				            		'focus':function(field){
				            			if (!Ext.getCmp('comWin')) {
					            			window.win = new Ext.Window({
					            				id:'comWin',
					            				title:'选择组织机构(双击)',
					            				renderTo:Ext.getBody(),
					            				width:450,
					            				height:400,
					            				y:80,
					            				modal:true,
					            				autoScroll:true,
					            				items:[{
					            					xtype:'treepanel',
													animate:true,
												    header:false,
												    border:false,
												    collapsible:true,
												    rootVisible:true,
												    autoScroll:true,
												    autoHeight:true,
												    //containerScroll: true,
												    split: true,
												    padding:'5 0 0 0',
												    //useArrows:true,
												    width:'100%',
												    expanded:true,
												    loader: new Ext.tree.TreeLoader({  
													    dataUrl:AJAX_ROOT_URL+'/dataquality/companyTree',
												        preloadChildren: true,//若为true，则loader在节点第一次访问时加载"children"的属性  
												        clearOnLoad: false,
												        listeners:{
												    		'beforeload':function(loader,node) {
												         		loader.baseParams['comcode'] = node.attributes.comcode;
												         		loader.baseParams['uppcomcode'] = node.attributes.uppcomcode;
												         		loader.baseParams['gradelevel'] = node.attributes.gradelevel;
													        }
												        }
												    }),  
												    root:{
										  				id:'0',
										  				comcode:config.userCompany.comcode,
										  				uppcomcode: config.userCompany.uppcomcode,
										  				gradelevel: config.userCompany.gradelevel,
														text: config.userCompany.text,
												        leaf:config.userCompany.leaf,
												        comcname:config.userCompany.comcname,
												        nodeType: 'async'
												    },
													listeners:{
														'close':function(p){
					            							window.win = null;
														},
														'dblclick':function(node,e) {
															Ext.getCmp('comcode').setValue('['+node.attributes.comcode+']'+node.attributes.comcname);
															Ext.getCmp('comcode').data = node.attributes;
															
															if (Ext.getCmp('checkPoint')) {
																Ext.getCmp('checkPoint').store.load({
										            				params: {
																		'checkDate': Ext.getCmp('checkDate').getValue(),
														                'product': Ext.getCmp('product').getValue(),
														                'comcode': node.attributes.comcode
														            }
										            			});
															}
															e.stopEvent();
															window.win.hide();
														}
													}
					            				}]
					            			});
					            			}
				            			window.win.show();
				            		}
				                }
			                }]
		                }]
				    };
			    }
			    elementArray = [row1, row2];
			    return elementArray;
		    },
		 
		    //构造器
		    constructor: function(config){
		        config = config || {};
		        
		        var eArray = this.createFormElement(config);
		        var configs = Ext.apply({
		            closable: true,
		            autoScroll: true,
		            layout: "anchor",
		            items:[
		            	new Ext.form.FormPanel({
					    	plain:true,
					    	frame:true,
					    	bodyStyle:'border-width:0;height:95.5%;width:100%',
							layout:"form",
							//defaultType:"textfield",
							labelWidth:75,
					        //baseCls:"x-plain",
							//defaults:{anchor:"30%",msgTarget:"side"},
							anchor:'100%',
							autoHeight:true,
							buttonAlign:"right",
							labelAlign:"center",
							//bodyStyle:"padding:10 10 10 10",
					    	items:eArray,
					    	buttons:[{
					    		text:'查询',
					    		handler: this.onSearch,
					    		scope:this
					    	}]
					    }), 
					    this.initGridPanel
				    ],
		            /**
		              *渲染数据
		              */
		            //链接
		            linkRenderer: function(v){
		                if (!v) 
		                    return "";
		                else 
		                    return String.format("<a href='{0}' target='_blank'>{0}</a>", v);
		            },
		            //时间
		            dateRender: function(format){
		                format = format || "Y-m-d h:i";
		                return Ext.util.Format.dateRenderer(format);
		            }
		        },config);
		        //调用父类的构造器
		        check.BaseDataQualityQuery.superclass.constructor.call(this,configs);
		    }
		});